﻿using System;
using System.Globalization;

class HexadecimalAsDecimal
{
    static void Main()
    {
        string binaryNumber = "1e0f3";
        int decimalNumber = 0;

        for (int i = 0; i < binaryNumber.Length; i++)
        {
            string str = binaryNumber[binaryNumber.Length - 1 - i].ToString().ToLower();
            switch (str)
            {
                case "a":
                    str = "10";
                    break;
                case "b":
                    str = "11";
                    break;
                case "c":
                    str = "12";
                    break;
                case "d":
                    str = "13";
                    break;
                case "e":
                    str = "14";
                    break;
                case "f":
                    str = "15";
                    break;
            }

            int letter = int.Parse(str);
            decimalNumber += letter * (int)Math.Pow(16, i);
        }
        Console.WriteLine(decimalNumber);
    }
}
